package com.ybkj.o2o.mc.controller.web;

import com.ybkj.o2o.mc.common.DataGrid;
import com.ybkj.o2o.mc.entity.PassengerGrade;
import com.ybkj.o2o.mc.manager.PassengerGradeManager;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by shine on 15/8/19.
 */
@RestController
@RequestMapping("passengerGrade")
public class PassengerGradeController {

  @Autowired
  private PassengerGradeManager passengerGradeManager;

  @RequestMapping(value = {"datagrid"}, method = RequestMethod.GET)
  @ResponseBody
  public DataGrid<PassengerGrade> list(@RequestParam("page") int page,
                                       @RequestParam("rows") int rows) {

    return passengerGradeManager.findAll(page, rows);
  }


  @RequestMapping(value = {"listByAppKey"}, method = RequestMethod.GET)
  @ResponseBody
  public List<PassengerGrade> listByAppKey(@RequestParam("appKey") String appKey) {

    return passengerGradeManager.findByAppKey(appKey);
  }


}
